package org.batch.config;

import cn.hutool.core.lang.Snowflake;
import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * 系统上下文相关配置
 *
 * @author LiKun
 * @date 2021/9/6 8:23
 */
@Configuration
@MapperScan("org.batch.mapper")
@ComponentScan({"com.knife", "org.cleaver.spring"})
public class SystemConfig {
    @Bean
    public Snowflake snowflake() {
        return new Snowflake(1, 1);
    }

    @Bean
    public OptimisticLockerInnerInterceptor optimisticLockerInnerInterceptor() {
        return new OptimisticLockerInnerInterceptor();
    }
}
